﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Gear.Web.Api.DynamicDataApi.Model
{
    public class ImplementmModel
    {
        /// <summary>
        /// 方法ID
        /// </summary>
        public int actionid { get; set; }
        /// <summary>
        /// 执行类型
        /// </summary>
        public ExecuteType ExecuteType { get; set; }
        /// <summary>
        /// 执行内容
        /// </summary>
        public string ExecuteContent { get; set; }
        /// <summary>
        /// 执行参数
        /// </summary>
        public Dictionary<string, object> Param { get; set; }
        /// <summary>
        /// 执行数据连接池
        /// </summary>
        public SqlSugarClient repository { get; set; }
    }
    public enum ExecuteType
    {
        MapGet = 1,// 获取数据 ContentsExample: "select 1 from dual"
        MapRun = 2,// 执行sql ContentsExample: "insert:table" or "update:table" or "delete:table"
        MapProcedure = 3,// 执行存储过程 ContentsExample: "procedure"
        MapClassFun =4,// 执行内置方法 ContentsExample: ""
        MapHttpApi = 5,// 执行内置方法 ContentsExample: ""
    }

    /// <summary>
    ///  数据获取执行参数
    /// </summary>
    public class ExecParm
    {
        /// <summary>
        /// 执行方法ID
        /// </summary>
        public int id { get; set; }
        // 执行类型
        public int executetype { get; set;}
        // 执行语句
        public string contents { get; set; }
        // 执行鉴权
        public int auth { get; set; }
        // 控制器ID
        public int controllerid { get; set; }
    }

}
